package ma.ac.onousc.gestionfi.budget.model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the role_personnel database table.
 * 
 */
@Embeddable
public class RolePersonnelPK implements Serializable {
	// default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name = "ID_PERSONNEL")
	private int idPersonnel;

	@Column(name = "ID_ROLE")
	private int idRole;

	public RolePersonnelPK() {
	}

	public int getIdPersonnel() {
		return this.idPersonnel;
	}

	public void setIdPersonnel(int idPersonnel) {
		this.idPersonnel = idPersonnel;
	}

	public int getIdRole() {
		return this.idRole;
	}

	public void setIdRole(int idRole) {
		this.idRole = idRole;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof RolePersonnelPK)) {
			return false;
		}
		RolePersonnelPK castOther = (RolePersonnelPK) other;
		return (this.idPersonnel == castOther.idPersonnel)
				&& (this.idRole == castOther.idRole);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.idPersonnel;
		hash = hash * prime + this.idRole;

		return hash;
	}
}